<template>
  <div>
    <s-table
      size="default"
      :columns="columns"
      :data="loadData"
      :alert="false"
      :pagination="{ pageSize: 10 }"
    >
      <template slot="xxqsrq" slot-scope="a">
        {{ a.slice(0, 11) }}
      </template>
      <template slot="xxzzrq" slot-scope="a">
        {{ a.slice(0, 11) }}
      </template>
    </s-table>
  </div>
</template>

<script>
import { STable } from '~'

export default {
  props: ['xh','checked'],
  components: {
    STable
  },
  data () {
    return {
      columns: [
        {
          title: this.$t('key.startTime'),
          dataIndex: 'xxqsrq',
          scopedSlots: { customRender: 'xxqsrq' }
        },
        {
          title: this.$t('key.endTime'),
          dataIndex: 'xxzzrq',
          scopedSlots: { customRender: 'xxzzrq' }
        },
        {
          title: this.$t('key.unit'),
          dataIndex: 'xxdw'
        },
        {
          title: this.$t('key.whatJob'),
          dataIndex: 'drzw'
        },
        // {
        //   title: this.$t('key.learningContent'),
        //   dataIndex: 'xxnr'
        // }
      ],
      loadData: parameter => {
        // parameter.pageNum = parameter.pageNo
        // let params = Object.assign(this.queryParam, parameter)
        if(this.checked){
          return this.$api.student.studentBcResume(this.xh).then(res => {
            console.log(res)
            return {
              data: res.data,
              pageNo: parameter.pageNo,
              pageSize: parameter.pageSize,
              totalPage: 1,
              totalCount: 1
            }
          })
        }else{
          return this.$api.student.studentResume(this.xh).then(res => {
            console.log(res)
            return {
              data: res.data,
              pageNo: parameter.pageNo,
              pageSize: parameter.pageSize,
              totalPage: 1,
              totalCount: 1
            }
          })
        }
      }
    }
  }
}
</script>

<style>

</style>
